package apy.codecase.business.view.fragment;

import android.widget.Button;

import org.greenrobot.eventbus.EventBus;

import apy.codecase.R;
import apy.codecase.base.BaseFragment;
import apy.codecase.greendao.PswDaoUtils;
import butterknife.BindView;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by Administrator on 2017/10/25.
 */

public class MeFragment extends BaseFragment {

    @BindView(R.id.me_del_all_psw)
    Button meDelAllPsw;
    Unbinder unbinder;

    @Override
    protected int initLayout() {
        return R.layout.fragment_me;
    }

    @OnClick(R.id.me_del_all_psw)
    public void onViewClicked() {
        PswDaoUtils utils = new PswDaoUtils(getActivity());
        boolean state = utils.deleteAll();
        if(state){
            EventBus.getDefault().post("delAllPsw");
        }
    }
}
